#define GDK_WINDOWING_WAYLAND"
DISABLE_ON_WAYLAND='%'
WAYLAND_PACKAGES="wayland-client >= 1.1.90 xkbcommon >= 0.2.0 wayland-cursor"
+
+ AC_PATH_PROG([WAYLAND_SCANNER],[wayland-scanner],[no])
+ AS_IF([test "x$WAYLAND_SCANNER" = "xno"],
+ AC_MSG_ERROR([Could not find wayland-scanner in your PATH, required for parsing wayland extension protocols]))
+ AC_SUBST([WAYLAND_SCANNER])
+
AM_CONDITIONAL(USE_WAYLAND, true)
else
AM_CONDITIONAL(USE_WAYLAND, false)
noinst_LTLIBRARIES = \
libgdk-wayland.la
+BUILT_SOURCES = \
+ gtk-shell-client-protocol.h \
+ gtk-shell-protocol.c
+
libgdk_wayland_la_SOURCES = \
+ $(BUILT_SOURCES) \
gdkapplaunchcontext-wayland.c \
gdkcursor-wayland.c \
gdkdevice-wayland.c \
gdkwaylandselection.h \
gdkwaylandwindow.h
+%-protocol.c : protocol/%.xml
+ $(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@
+%-server-protocol.h : protocol/%.xml
+ $(AM_V_GEN)$(WAYLAND_SCANNER) server-header < $< > $@
+%-client-protocol.h : protocol/%.xml
+ $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@
+
+EXTRA_DIST += protocol/gtk-shell.xml
+
-include $(top_srcdir)/git.mk
} else if (strcmp(interface, "wl_shell") == 0) {
display_wayland->shell =
wl_registry_bind(display_wayland->wl_registry, id, &wl_shell_interface, 1);
+ } else if (strcmp(interface, "gtk_shell") == 0) {
+ display_wayland->gtk_shell =
+ wl_registry_bind(display_wayland->wl_registry, id, >k_shell_interface, 1);
} else if (strcmp(interface, "wl_output") == 0) {
output =
wl_registry_bind(display_wayland->wl_registry, id, &wl_output_interface, MIN (version, 2));
#include <stdint.h>
#include <wayland-client.h>
#include <wayland-cursor.h>
+#include "gtk-shell-client-protocol.h"
#include <glib.h>
#include <gdk/gdkkeys.h>
struct wl_compositor *compositor;
struct wl_shm *shm;
struct wl_shell *shell;
+ struct gtk_shell *gtk_shell;
struct wl_input_device *input_device;
struct wl_data_device_manager *data_device_manager;
struct wl_surface *surface;
struct wl_shell_surface *shell_surface;
+ struct gtk_surface *gtk_surface;
unsigned int mapped : 1;
GdkWindow *transient_for;
GdkWindowTypeHint hint;
wl_surface_set_user_data(impl->surface, window);
wl_surface_add_listener(impl->surface,
&surface_listener, window);
+
+ if (display_wayland->gtk_shell)
+ impl->gtk_surface = gtk_shell_get_gtk_surface (display_wayland->gtk_shell,
+ impl->surface);
}
static void
}
else if (impl->surface)
{
+ if (impl->gtk_surface)
+ gtk_surface_destroy(impl->gtk_surface);
+ impl->gtk_surface = NULL;
+
wl_surface_destroy(impl->surface);
impl->surface = NULL;
--- /dev/null
+<protocol name="gtk">
+
+ <interface name="gtk_shell" version="1">
+ <request name="get_gtk_surface">
+ <arg name="gtk_surface" type="new_id" interface="gtk_surface"/>
+ <arg name="surface" type="object" interface="wl_surface"/>
+ </request>
+ </interface>
+
+ <interface name="gtk_surface" version="1">
+ <request name="set_dbus_properties">
+ <arg name="application_id" type="string" allow-null="true"/>
+ <arg name="app_menu_path" type="string" allow-null="true"/>
+ <arg name="menubar_path" type="string" allow-null="true"/>
+ <arg name="window_object_path" type="string" allow-null="true"/>
+ <arg name="application_object_path" type="string" allow-null="true"/>
+ <arg name="unique_bus_name" type="string" allow-null="true"/>
+ </request>
+ </interface>
+
+</protocol>